package com.yc.springmvc.biz;

import com.yc.springmvc.bean.User;
import com.yc.springmvc.biz.BizException;
import org.springframework.stereotype.Service;

@Service
public class UserBiz {

    public void register(User user) throws BizException {
        if(user.getName().equals("yc")){
            throw new BizException("应该用户已经注册!");
        }
        if(user.getPhone().equals("12345678900")){
            throw new BizException("应该电话号码已经注册!");
        }
        System.out.println("注册成功....");
    }

}
